import java.util.*;

public class StudentManager {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        
        Student s1 = new Student("001", "张三", "计算机班");
        Student s2 = new Student("002", "李四", "计算机班");
        Teacher t1 = new Teacher("T01", "王老师", "计算机学院");
        Course c1 = new Course("C01", "Java编程", 3.0);
        Course c2 = new Course("C02", "数据结构", 4.0);
        
        System.out.print("输入张三的Java成绩: ");
        double score1 = input.nextDouble();
        System.out.print("输入李四的Java成绩: ");
        double score2 = input.nextDouble();
        
        try {
            Score sc1 = new Score(s1, c1, score1);
            Score sc2 = new Score(s2, c1, score2);
            
            System.out.println("\n=== 学生信息 ===");
            s1.displayInfo();
            s2.displayInfo();
            
            System.out.println("\n=== 教师信息 ===");
            t1.displayInfo();
            
            System.out.println("\n=== 课程信息 ===");
            c1.displayInfo();
            c2.displayInfo();
            
            System.out.println("\n=== 成绩信息 ===");
            sc1.displayInfo();
            sc2.displayInfo();
            
        } catch (Score.ScoreException e) {
            System.out.println("错误: " + e.getMessage());
        }
        
        input.close();
    }
}